<template>
  <div id="user">
    <myLoading v-if="loading" />
    <div class="user-main" v-else>
      <div class="title">
        <HomeTitle :title="Data.info.UserName" Eng="UserInfo"></HomeTitle>
      </div>
      <div class="top">
        <div class="left">
          <img
            class="avatar"
            :src="
              Data.info.headerurl
                ? baseApi + Data.info.headerurl
                : baseApi + 'UserHeader\\20230214105739655.jpg'
            "
          />
        </div>
        <div class="info">
          <div class="item">
            <div class="label">姓名</div>
            <div class="value">：{{ Data.info.UserName }}</div>
          </div>
          <div class="item">
            <div class="label">账号</div>
            <div class="value">：{{ Data.info.UserAccount }}</div>
          </div>
          <div class="item">
            <div class="label">电话</div>
            <div class="value">：{{ Data.info.PhoneNumber }}</div>
          </div>
          <div class="item">
            <div class="label">个性签名</div>
            <div class="value">：{{ Data.info.Signature }}</div>
          </div>
        </div>
      </div>
      <div class="histroy">
        <div class="title">
          <HomeTitle title="下载记录" Eng="HistoryDownList"></HomeTitle>
        </div>
      </div>
    </div>
  </div>
</template>

<script>
import { onMounted, onUnmounted, reactive, ref, toRefs } from "vue";
import { useRoute, useRouter } from "vue-router";
import * as OfficeApi from "@/api/office";
import * as UserApi from "@/api/user";
import { storeUser } from "@/store/user";
import HomeTitle from "@/components/title.vue";
import Avatar from '@/assets/pics/avatar.png'
export default {
  name: "",
  components: {
    HomeTitle,
  },
  setup(props, ctx) {
    const user = storeUser();
    const router = useRouter();
    const route = useRoute();
    const loading = ref(false);
    const Data = reactive({
      info: {},
    });
    const getUserInfo = async () => {
      loading.value = true;
      let { data } = await UserApi.getUser({
        UserAccount: route.query.account,
      });
      Data.info = data.UserData;
      loading.value = false;
    };
    onMounted(() => {
      getUserInfo();
    });
    return {
      loading,
      Avatar,
      user,
      Data,
    };
  },
};
</script>

<style scoped lang="scss">
::v-deep(.el-form-item__label) {
  color: #fff !important;
}
::v-deep(.el-textarea__inner) {
  background: transparent !important;
  color: #fff !important;
}

::v-deep(.el-input__wrapper) {
  background: transparent !important;
  color: #fff !important;
}
::v-deep(.el-table) {
  background: transparent !important;
  color: #fff !important;
}
::v-deep(.el-table tr) {
  background: transparent !important;
  color: #fff !important;
}
::v-deep(.el-table__cell) {
  background: transparent !important;
  color: #fff !important;
}
::v-deep(.el-input__inner) {
  // background: transparent !important;
  color: #fff !important;
}
#user {
  position: relative;
  width: 100%;
  height: 100%;
  border-top-left-radius: 30px;
  overflow-y: auto;
  background: var(--box-bg-color);

  .user-main {
    display: flex;
    flex-direction: column;
    height: 100%;
    width: 100%;
    padding: 30px 20px;
    box-sizing: border-box;
    .top {
      height: 300px;
      margin-bottom: 20px;
      display: flex;
      padding: 20px 40px;
      .left {
        width: 300px;
        margin-right: 40px;
        .avatar {
          width: 100%;
          border-radius: 50%;
          object-fit: cover;
        }
      }
      .info {
        padding-top: 80px;
        .item {
          display: flex;
          margin: 20px 0;
          .label {
            width: 80px;
          }
        }
      }
    }
    .history {
      flex: 1;
    }
  }
}
</style>
